package com.situ.ssm.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.ssm.entity.Student;
import com.situ.ssm.service.IStudentService;
import com.situ.ssm.service.impl.StudentServiceImpl;

@Controller
@RequestMapping("/student")
public class StudentController {
	
	private IStudentService studentService = new StudentServiceImpl();
	
	@RequestMapping("/selectAll")
	@ResponseBody
	public List<Student> selectAll() {
//		Student student1 = new Student(1, "张三1", 22, "男");
//		Student student2 = new Student(2, "张三2", 23, "男");
//		Student student3 = new Student(3, "张三3", 24, "男");
//		
//		List<Student> list = new ArrayList<Student>();
//		list.add(student1);
//		list.add(student2);
//		list.add(student3);
		
		return studentService.selectAll();
//		return list;
	}
}
